#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define str string
#define all(x) (x).begin(),(x).end()
#define ms(a,t) memset(a,t,sizeof(a))
#define pii pair<int,int>
#define pll pair<ll,ll>
#define MP make_pair
#define pb push_back
#define fi first
#define se second
#define db double
const int maxn = 5e6+10;
const int mod = 998244353;
const ll INF = 0x3f3f3f3f;
const db eps = 1e-7;
int n,m,k;
int fa[maxn],siz[maxn];
int cnt[maxn];
int find(int x) {
	return ((fa[x] == x) ? x : (fa[x] = find(fa[x])));
}
void merge(int x,int y) {
	x = find(x); y = find(y);
	if(x == y) return;
	if(siz[x] > siz[y]) swap(x,y);
	fa[x] = y; siz[y] += siz[x];
}
bool vis[maxn];
vector<int> G[maxn];
vector<int> ans[maxn];
vector<int> id;
void work(int x,int y) {
	for(int i = ans[y].size()-1; i >= 0; i--) {
		ans[x].pb(ans[y][i]);
	}
	id.pb(x);
}
bool d[maxn];
int dfs(int x) {
	d[x] = true; 
	int ret = 0; 
	if(vis[x]) ret = x,ans[ret].pb(x);
	for(int to : G[x]) if(!d[to]) {
		int tmp = dfs(to);
		if(tmp) {
			if(ret) {
				work(tmp,ret);
				ret = 0;
			} else {
				ret = tmp; ans[ret].pb(x);
			}
		}
	}
	return ret;
}
void Solve() {
	cin >> n >> m >> k;
	for(int i = 1; i <= n; i++) {
		fa[i] = i; siz[i] = 1;
	}
	for(int i = 1,u,v; i <= m; i++) {
		cin >> u >> v; G[u].pb(v); G[v].pb(u);
		merge(u,v);
	}
	for(int i = 1; i <= k; i++) {
		int x; cin >> x; vis[x] = true;
		cnt[find(x)]++;
	}
	for(int i = 1; i <= n;i++) if(fa[i] == i) {
		dfs(i);
	}
	cout<<id.size()<<'\n';
	for(int x : id) {
		cout<<ans[x].size()<<' ';
		for(int y : ans[x]) {
			cout<<y<<' ';
		}
		cout<<'\n';
	}
}
int main() {
	freopen("travel.in","r",stdin);
	freopen("travel.out","w",stdout);
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//	int T; cin >> T; while(T--)
	Solve();
	return 0;
}
